package com.cskaoyan.javase.oop2._1extends._7initialization._0introduction;

/**
 * 测试类加载
 * 只要是子类触发类加载，不管是何种方式，都会优先从顶层父类开始进行类加载
 *
 * @since 11:30
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class TestClassLoad extends Grandson {
    public static void main(String[] args) {
        // Grandson gs = new Grandson();
    }
}

class Father {
    static {
        System.out.println("Father");
    }
}

class Son extends Father {
    static {
        System.out.println("Son");
    }
}

class Grandson extends Son {
    static {
        System.out.println("Grandson");
    }
}